import { createWebHistory, createRouter } from 'vue-router'

import { defineAsyncComponent } from 'vue'
const main = () => import('@/view/main.vue')
// 异步加载远程路由页面
const ShareView = defineAsyncComponent(() =>
  import('packages_center/ShareView')
);
const ShareAboutView = defineAsyncComponent(() =>
  import('packages_center/AboutView')
);
const ShareHomeView = defineAsyncComponent(() =>
  import('packages_center/HomeView')
);


const routes = [

  { path: '/', component: main },
  { path: '/shared', component: ShareView },
  { path: '/about', component: ShareAboutView },
  { path: '/share', component: ShareView },
  { path: '/home', component: ShareHomeView },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router